package com.example.fullexample.service.query;

import com.example.fullexample.service.domain.Student;
import com.example.fullexample.util.ApplicationContextHolder;
import com.example.fullexample.util.Query;

public class StudentQuery implements Query<Student> {

    private final StudentQueryHandler handler;

    public StudentQuery() {
        this.handler = ApplicationContextHolder.getApplicationContext()
                .getBean(StudentQueryHandler.class);
    }

    @Override
    public Student execute() {
        return handler.action(this);
    }

}
